package com.kaluli.project.controller;

import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.kaluli.project.domain.entity.KllMq;
import com.kaluli.project.domain.entity.KllProductVo;
import com.kaluli.project.service.KllKolOrderService;
import com.kaluli.project.service.KllMainOrderService;
import com.kaluli.project.service.KllMqService;
import com.kaluli.project.service.KllOrderSynApiService;
import com.kaluli.project.service.KllProductService;
import com.kaluli.project.utils.MD5Utils;
import com.kaluli.project.utils.RegexUtil;
import com.kaluli.project.utils.nanshaxml.XmlFanli;

/**
 * 
 * 日志接口
 * 
 * @author niwei
 * 
 */
@Controller
@PropertySource({ "classpath:config.properties" })
public class MqController {

	private static Logger log = Logger.getLogger(MqController.class);

	@Autowired
	private Environment env;

	@Autowired
	private KllMqService kllMqService;
	
	@Autowired
	private KllKolOrderService kllKolOrderService;

	@RequestMapping(value = "/mq/findMqList")
	@ResponseBody
	public String findMqList(@RequestParam(value="orderNumber",required=true) String orderNumber,
			@RequestParam(value="channel",required=true)String channel) {
		
		List<KllMq> mqList=kllMqService.getByOrderNumber(orderNumber, channel);
		String json=JSONObject.toJSONString(mqList);
		return json;
		
	}
	
	
	
	@RequestMapping(value = "/lol/order")
	@ResponseBody
	public void updateKolOrder(@RequestParam(value="orderNumber",required=true) String orderNumber) {
		kllKolOrderService.updateKolOrder(orderNumber);
		
	}

}
